package com.example.smartcity.ui.Adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.example.smartcity.R;
import com.example.smartcity.ui.Bean.ChangeBean;

import java.util.List;

public class ChangePwsAdapter extends ArrayAdapter<ChangeBean> {
    private int resource;
    public ChangePwsAdapter(@NonNull Context context, int resource, @NonNull List<ChangeBean> objects) {
        super(context, resource, objects);
        this.resource = resource;
    }

    @NonNull
    @Override
    public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
        ChangeBean bean = getItem(position);
        View view = LayoutInflater.from(getContext()).inflate(resource,parent,false);
        EditText editText = view.findViewById(R.id.item);
        editText.setTag(position);
        editText.setHint(bean.getText());
        return view;
    }
}
